package com.example.cart_system.service.Impl;

import com.example.cart_system.mapper.ChartsMapper;
import com.example.cart_system.service.ChartsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Service
public class ChartsServiceImpl implements ChartsService {
    @Autowired
    private ChartsMapper chartsMapper;
    @Override
    public List<String> getAllYear(String usrid) {
        return chartsMapper.getAllYear(usrid);
    }

    @Override
    public List<String> getAllMonth(String usrid, String year) {
        return chartsMapper.getMonth(usrid, year);
    }

    @Override
    public List<Map<String, Object>> getSumByYearAndMonth(String usrid, String year, String month) {
        return chartsMapper.getSumByYearAndMonth(usrid, year, month);
    }
}
